Show:

Q touchscroll Class

jQuery plugin for scrolling 'overflow: hidden' containers on touch devices. But it also can be used on desktop devices where mouse events will be used instead of touch events. Supposed to be replacement for iScroll and has similar look, functionality and API.

Constructor

Q touchscroll

(
  • [Object_or_String]
  • reserved1
  • reserved2
)

Parameters:

  • [Object_or_String] Mixed optional

    Mixed function parameter that could be Object or String

    • [Object] Object optional

      If an object then it's a hash of options, that can include:

      • [x] Number optional
        Integer which sets initial horizontal scroll position. Optional.
      • [y] Number optional
        Integer which sets initial vertical scroll position. Optional.
      • [inertia] Boolean optional
        Boolean which indicates whether to apply 'intertial scrolling', meaning that after releasing the finger while in movement the scrolling will continue with initial finger-given speed that is slowly fading down.
      • [scrollbar] String optional
        String value which can be either 'inner' or 'outer' determining where to actually place scrollbar element in the DOM tree. If the value is 'inner' then scrollbar is appended to the element to which plugin is applied. If the value is 'outer' then scrollbar is appended to document.body. Optional.
      • [hideScrollbar] Boolean optional
        Boolean which indicates whether to hide scrollbar when no scrolling occurs.
      • [fadeScrollbar] Boolean optional
        Boolean which indicates whether to fade scrollbars instead of just hiding them. Depends on 'hideScrollbar' options and works only it it's true.
      • [indicators] Boolean optional
        Boolean which indicates whether to show scroll indicators (apply Q/scrollIndicators plugin).
      • [onRefresh] Q.Event optional
        Q.Event callback which is called when touchscroll('refresh') is called.
      • [onScrollStart] Q.Event optional
        Q.Event callback which is called when scrolling is just started. Optional.
      • [onScrollMove] Q.Event optional
        Q.Event callback which is called when scrolling is in progress (while finger is moving or when inertial scrolling is applied). Optional.
      • [onScrollEnd] Q.Event optional
        Q.Event callback which is called when scrolling is ended. Optional.
      • [onTouchEnd] Q.Event optional
        Q.Event callback which is called when finger is released but scrolling still may continue (due to inertial scrolling). Optional.
    • [String] String optional

      If a string then it's a command and it can have following values: "remove": Destroys the plugin so the container won't have touch scrolling functionality anymore. "refresh": Refreshes the plugin. Useful then container size is changed to update scrollbar and other stuff. "bind": Allows to bind Q.Event handlers to previously described events, such as 'onScrollMove'. In this case 'reserved1' is event name and 'reserved2' is a callback function.

  • reserved1 Mixed

    varying Some additional parameter in case if 'options' is a command.

  • reserved2 Mixed

    varying Some additional parameter in case if 'options' is a command.

Item Index